import request from '@/utils/request'

/**
 *
 * @returns 获取组织架构数据
 */
export function getDepartments() {
  return request({
    url: '/company/department'
  })
}

/**
 * 删除部门
 */
export function delDepartments(id) {
  return request({
    method: 'delete',
    url: `/company/department/${id}`
  })
}

/**
 * 查询部门
 */
export function selectDepartments(id) {
  return request({
    method: 'get',
    url: `/company/department/${id}`
  })
}

/**
 * 修改部门
 */
export function editDepartments(id, data) {
  return request({
    method: 'put',
    url: `/company/department/${id}`,
    data
  })
}

/**
* 添加部门
*/
export function addDepartments(data) {
  return request({
    method: 'post',
    url: `/company/department`,
    data
  })
}
